package com.cirkana.viewer.qr;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

import jp.sourceforge.qrcode.data.QRCodeImage;

public class QRCodeImageImpl implements QRCodeImage {

	private BufferedImage image;

	public QRCodeImageImpl(String imageFile) throws IOException {
		File inputFile = new File(imageFile);
		this.image = ImageIO.read(inputFile);
	}

	@Override
	public int getHeight() {
		return this.image.getHeight();
	}

	@Override
	public int getPixel(int x, int y) {
		return this.image.getRGB(x, y);
	}

	@Override
	public int getWidth() {
		return this.image.getWidth();
	}

}
